package com.yimi.appstore.db.dao;

import com.yimi.appstore.db.EntityBase;

public class AppInfoEntity implements EntityBase {

	@Override
	public String getCreateTableSql() {
		String sql = "CREATE TABLE IF NOT EXISTS  " + APPINFO_TABLE_NAME + " ("
				+ AppInfoEntity._ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
				+ AppInfoEntity.APP_NAME + " NVARCHAR(30) NOT NULL,"
				+ AppInfoEntity.APP_ICON + " BLOB,"
				+ AppInfoEntity.APP_PACKAGE_NAME + " NVARCHAR(500)  NOT NULL,"
				+ AppInfoEntity.APP_VERSION_NAME + " NVARCHAR(50)  NOT NULL,"
				+ AppInfoEntity.APP_VERSION_CODE + " NVARCHAR(50)  NOT NULL,"
				+ AppInfoEntity.APP_SOURCE_DIR + " NVARCHAR(250)  ,"
				+ AppInfoEntity.APP_SIZE + " INTEGER DEFAULT '0'  ,"
				+ AppInfoEntity.APP_TARNS_FLAG
				+ " INTEGER  DEFAULT '-1' NOT NULL,"
				+ AppInfoEntity.APP_SYSTEM_FALG
				+ " INTEGER  DEFAULT '0' NOT NULL" + " )";
		return sql;
	}

	@Override
	public String[] getInitTableSql() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String[] getUpdateTableSql() {
		// TODO Auto-generated method stub
		return null;
	}

	/**
	 * 本地应用表名
	 */
	public static final String APPINFO_TABLE_NAME = "local_app_info";

	/**
	 * 自增id 主键 INTEGER 非空
	 */
	public static final String _ID = "_id";

	/**
	 * 应用名
	 */
	public static final String APP_NAME = "name";

	/**
	 * 应用包名
	 */
	public static final String APP_PACKAGE_NAME = "package_name";
	
	/**
	 * 应用icon
	 */
	public static final String APP_ICON = "icon";	

	/**
	 * 应用版本名
	 */
	public static final String APP_VERSION_NAME = "version_name";

	/**
	 * 应用版本号
	 */
	public static final String APP_VERSION_CODE = "version_code";

	/**
	 * 应用安装位置
	 */
	public static final String APP_SOURCE_DIR = "source_dir";

	/**
	 * 应用大小
	 */
	public static final String APP_SIZE = "size";

	/**
	 * 应用是否可移动标识 -1 不可移动 0 在手机中可移动到sdk 1 在sdk中可移动到手机
	 */
	public static final String APP_TARNS_FLAG = "trans_flag";

	/**
	 * 应用是否系统应用标识 1 系统应用 0本地应用
	 */
	public static final String APP_SYSTEM_FALG = "system_falg";
}
